package com.ziytek.web.citizen.constant;

/**
 * @author fenghx
 * @version v1.0
 * @className ServerConstant
 * @descripton 常量类
 * @date 2023/4/11 15:32
 **/
public class ServerConstant {

    public static final String SUCCESS = "0";
    public static final String TRUE = "true";
    public static final String ERROR = "-200";
    public static final String SUCCESS_MSG = "success";
    public static final String ERROR_MSG = "query error";
    public static final String DB_START_WITH = "Data_";
    public static final String DB_END_WITH = ".db";
    public static final String STR_EMPTY = "";
    public static final String STR_EMPTY_TWO = ":";
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    public static final String DATE_FORMAT_TWO = "yyyyMMddHHmmss";
    public static final String DATE_FORMAT_DAY_TWO = "yyyyMMdd";
    public static final String DATE_FORMAT_DAY_THREE = "yyyy-MM-dd";
    public static final String DATE_FORMAT_DAY_SIX = "yyMMdd";
    public static final String DATE_FORMAT_TIME = "HH:mm:ss";
    public static final String DATE_FORMAT_TIME_STR = "HHmmss";
    public static final String TCP_SERVICE_BEAN = "nettyTcpServiceBean";
    public static final String INTERRUPT_ID = "-1";

    // 数据分割符
    public static final String DATA_SEPARATOR = ",";
    public static final String DATA_SEPARATOR_LIND = "-";

    // 空格
    public static final String DATA_SEPARATOR_BLANK_SPACE = " ";
    public static final String DATA_SEPARATOR_SPACE = "-";

    // CMD命令类型
    //  0x01 - LED灯控制
    //  0x02 - 充放电控制设置
    //  0x03 - 数据查询
    //  0x04 - 设置参数
    //  0x06 - 获取分容结果
    //  0x07 - 业务请求
    //  0x08 - 业务请求响应
    //  0x09 - 分容结果请求
    //  0x10 - 分容结果响应
    public static final String CMD_TYPE_LED_CONTROL = "01";
    public static final String CMD_TYPE_CHARGE_DISCHARGE_CONTROL = "02";
    public static final String CMD_TYPE_DATA_QUERY = "03";
    public static final String CMD_TYPE_SET_PARAMETER = "04";
    public static final String CMD_TYPE_GET_CAPACITY = "06";
    public static final String CMD_TYPE_BUSINESS_REQUEST = "07";
    public static final String CMD_TYPE_BUSINESS_RESPONSE = "08";
    public static final String CMD_TYPE_CAPACITY_RESULT_REQUEST = "09";
    public static final String CMD_TYPE_CAPACITY_RESULT_RESPONSE = "10";

    public static final int DATA_TYPE_LEN_0 = 0;

    public static final int TYPE_CHARGE = 0;
    public static final int TYPE_DISCHARGE = 1;
    public static final int TYPE_SL = 3;

    public static final int DATA_TYPE_LEN_1 = 2;
    public static final int DATA_TYPE_LEN_START = 4;
    public static final int DATA_TYPE_LEN_END = 6;

    public static final int DATA_COUNT_ZERO = 0;
    public static final int PAGE_NUM_START = 1;
    public static final int PAGE_SIZE_START = 20;


    // 充放电控制协议数据
    public static final int CHARGE_CONTROL_PROTOCOL_DATA_LENGTH = 16;
    public static final int BATTERIES_DATA_LENGTH = 84;
    public static final int BATTERIES_ONE_DATA_LENGTH = 10;


    // 每个放电柜电池电芯总数
    public static final int BATTERY_NUM = 8;

    // 灯控状态 1-亮灯 0-灭灯
    public static final String LIGHT_CONTROL_STATUS_CLOSE = "0";
    public static final String SPRING_CONFIG = "spring-config";
    public static final String PRINT_THREAD_CONFIG = "print-thread-config";
    public static final String SQLITE_NAME = "sqlite-db-name";


    public static final String CUT_OFF_TYPE_C = "c";
    public static final String CUT_OFF_TYPE_V = "v";

    public static final String SIDE_A = "A";
    public static final String SIDE_B = "B";
    public static final String DOOR_L = "l";
    public static final String DOOR_R = "r";
    public static final String STRING_NULL = "null";


    public static final int STEP_SETTING_TYPE_ADD = 1;
    public static final int STEP_SETTING_TYPE_MODIFY = 2;
    public static final int STEP_SETTING_TYPE_DELETE = 3;

    // * 正面 左边门 右边门  front_left_door  front_right_door
    // * 反面 左边门 右边门  back_left_door  back_right_door
    public static final String DOOR_FRONT_LEFT = "front_left_door";
    public static final String DOOR_FRONT_RIGHT = "front_right_door";
    public static final String DOOR_BACK_LEFT = "back_left_door";
    public static final String DOOR_BACK_RIGHT = "back_right_door";

    public static final String JOB_TIMES = "jobTimes_";
    public static final String STATUS_ONLINE = "online";
    public static final String STATUS_OFFLINE = "offline";

    /**
     * 0-启用中 1- 终止或已停用 2- 已完成 3- 中断 99-异常
     */
    public static final int START_FLAG_NORMAL = 0;
    public static final int START_FLAG_DISABLE = 1;
    public static final int START_FLAG_FINISH = 2;
    public static final int START_FLAG_INTERRUPT = 3;
    public static final int START_FLAG_ERROR = 99;

    public static final int SINGLE_TYPE_ALL = 0;
    public static final int SINGLE_TYPE_SINGLE = 1;

    public static final int ERROR_EXCEPTION_TYPE_ERROR = 0;
    public static final int ERROR_EXCEPTION_TYPE_NORMAL = 1;
    public static final int PORT_TCP = 6666;
    public static final int PORT_SERVER = 14885;

    public static final String APP_DATA_JT_CABINET = "jtCabinet";
    public static final String APP_DATA_DATA = "data";
    public static final String APP_DATA_DB = "db";
}
